<div class="container top">
    
   <?php 
    //-----------------------------------------------------------------------------------------
      //flash messages
      if($this->session->flashdata('flash_message')){
          
        if($this->session->flashdata('flash_message') == 'updated')
        {
          echo '<div class="alert alert-success">';
            echo '<a class="close" data-dismiss="alert">×</a>';
            echo '<strong>Well done!</strong> Employee updated with success.';
          echo '</div>';       
        }else if($this->session->flashdata('flash_message') == 'deleted')
        {
          echo '<div class="alert alert-success">';
            echo '<a class="close" data-dismiss="alert">×</a>';
            echo '<strong>Well done!</strong> Employee deleted with success.';
          echo '</div>';       
        } else if($this->session->flashdata('flash_message') == 'not_deleted')
            {
          echo '<div class="alert alert-error">';
            echo '<a class="close" data-dismiss="alert">×</a>';
            echo '<strong>Oh snap!</strong> Employee did  not delete.';
          echo '</div>';          
        }
        else if($this->session->flashdata('flash_message') == 'added')
        {
          echo '<div class="alert alert-success">';
            echo '<a class="close" data-dismiss="alert">×</a>';
            echo '<strong>Well done!</strong> Employee added with success.';
          echo '</div>';       
        }
        else if($this->session->flashdata('flash_message') == 'not_added')
        {
          echo '<div class="alert alert-error">';
            echo '<a class="close" data-dismiss="alert">×</a>';
            echo '<strong>Oh snap!</strong> Employee did not add.';
          echo '</div>';       
        }
      }
  
    //effedt messages
    if($this->session->flashdata('num_row_effected')){
         if($this->session->flashdata('type')=='add'){
              echo '<div class="alert alert-success">';
              echo '<a class="close" data-dismiss="alert">×</a>';
              echo '<strong>Alert! '.$this->session->flashdata('table').' Table: </strong> Added '.$this->session->flashdata('num_row_effected').' rows.';
              echo '</div>'; 
         }else if($this->session->flashdata('type')=='update'){
             
              echo '<div class="alert alert-success">';
              echo '<a class="close" data-dismiss="alert">×</a>';
              echo '<strong>Alert! '.$this->session->flashdata('table').' Table: </strong> Updated '.$this->session->flashdata('num_row_effected').' rows.';
              echo '</div>'; 
             
         }else if($this->session->flashdata('type')=='del'){
              echo '<div class="alert alert-success">';
              echo '<a class="close" data-dismiss="alert">×</a>';
              echo '<strong>Alert! '.$this->session->flashdata('table').' Table: </strong> Deleted '.$this->session->flashdata('num_row_effected').' rows.';
              echo '</div>'; 
             
         }
        
    }
  
      
      ?>
   
  
      
      <ul class="breadcrumb">
        <li>
<!--          <a href="<?php echo site_url("admin"); ?>">-->
            <?php echo ucfirst($this->uri->segment(1));?>
<!--          </a> -->
          <span class="divider">/</span>
        </li>
        <li class="active">
          <?php echo ucfirst($this->uri->segment(2));?>
        </li>
      </ul>
     
      <div class="page-header users-header">
        <h2>
          <?php echo ucfirst($this->uri->segment(2));?> 
          <a  href="<?php echo base_url("index.php/workon/add") ?>" class="btn btn-success">Add a new</a>
        </h2>
      </div> 

      
      <div class="row">
        <div class="span12 columns">
          <!-- <div class="well"> -->
            <form class="navbar-form navbar-left" role="search">
               <ul class="nav nav-tabs ">
                    <li >
                      <a href="<?php echo base_url("index.php/employee") ?>" class="btn btn-default">Employee </a>
                    </li>
                    <li>
                            <a href="<?php echo base_url("index.php/project") ?>" class="btn btn-default">Project </a>
                    </li>
                    <li class="active"> 
                         <a href="<?php echo base_url("index.php/department") ?>" class="btn btn-default">Department </a>
                    </li>

                      <li class="active"> 
                         <a href="<?php echo base_url("index.php/workon") ?>" class="btn btn-default">Workon </a>
                    </li>
             </ul>

                <div>
                  <textarea class="form-control" style="width:600px;" rows="3"  placeholder="input query statement"></textarea>
                </div> <!-- End #input -->
                          
            </form>
          <table class="tablesorter  ">
            

            <thead>
              <tr>
                  <th >#</th>
                 <th>EMP_ID</th>
                 <th >PRO_ID</th>
                 <th ></th>
                 <th ></th>
             
              </tr>
            </thead>
                
              <?php
              $x=1;
              foreach($workon as $row)
              {
                  if(($x%2) ==0){
                  echo "<tr class='info' >";
                  }
                  else{
                      echo "<tr class='warning'>";
                  }
                  
                  echo "<td>".$x ."</td >";
                  
                
                 
                echo '<td>'.$row[0].'</td>';
                echo '<td>'.$row[1].'</td>';
             
                  
                  echo '<td>
                  <a href="'.base_url("index.php/workon/update").'/'.$row[0].'" class="btn btn-info">Edit</a>  
                    </td>';
                  echo '<td>
                  <a href="'.base_url("index.php/workon/delete").'/'.$row[0].'" class="btn btn-danger ">Del</a>  
                    </td>';
                  
                  $x = $x+1;
              }
              ?>                  
          
            
          </table>

          

      </div>
    </div>